/* webview/css/chat.css */

/* 欢迎语样式 - 居中显示 */
.welcome-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0.8;
}

.welcome-message h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.welcome-message .codicon {
    font-size: 28px;
}

.welcome-message p {
    margin: 0;
    color: var(--vscode-descriptionForeground);
}

#messages-container {
    display: flex;
    flex-direction: column;
    gap: var(--gap-medium);
    padding-bottom: 20px;
}

.msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-medium);
    line-height: 1.5;
    word-wrap: break-word;
}

.msg-user {
    align-self: flex-end;
    background-color: var(--vscode-button-background);
    color: var(--vscode-button-foreground);
    border-bottom-right-radius: 2px;
}

.msg-assistant {
    align-self: flex-start;
    background-color: var(--vscode-editor-inactiveSelectionBackground);
    color: var(--vscode-editor-foreground);
    border-bottom-left-radius: 2px;
}

.msg-system {
    align-self: center;
    font-size: 0.9em;
    opacity: 0.8;
    margin: 10px 0;
}

/* 流式加载动画 */
.msg.loading { opacity: 0.7; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* === 系统消息与确认卡片 (迁移自 styles.css) === */
.msg-system {
    align-self: center;
    font-size: 0.9em;
    max-width: 95%;
    background: transparent;
    padding: 0;
    border: none;
}

.confirmation-card {
    background-color: var(--vscode-editor-background);
    border: 2px solid var(--vscode-inputValidation-warningBorder);
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.confirmation-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--vscode-inputValidation-warningForeground);
}

.confirmation-title strong {
    color: var(--vscode-foreground);
}

.confirmation-info {
    background-color: var(--vscode-input-background);
    border: 1px solid var(--vscode-input-border);
    border-radius: 4px;
    padding: 12px;
    margin: 12px 0;
}

.info-label {
    font-size: 12px;
    color: var(--vscode-descriptionForeground);
    margin-bottom: 6px;
}

.info-value {
    font-family: var(--vscode-editor-font-family);
    font-size: 13px;
    background-color: var(--vscode-textCodeBlock-background);
    padding: 8px;
    border-radius: 4px;
    word-break: break-all;
    line-height: 1.5;
}

.info-value code {
    color: var(--vscode-textPreformat-foreground);
}

.confirmation-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.confirmation-buttons vscode-button {
    min-width: 100px;
}

/* 确认结果样式 */
.confirmation-result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
}

.confirmation-result.approved {
    background-color: var(--vscode-testing-iconPassed);
    color: #fff;
    border: 1px solid var(--vscode-testing-iconPassed);
}

.confirmation-result.rejected {
    background-color: var(--vscode-testing-iconFailed);
    color: #fff;
    border: 1px solid var(--vscode-testing-iconFailed);
}
}

/* === 聊天流中的工具调用状态卡片 === */
.tool-call-card {
    background: var(--vscode-textBlockQuote-background);
    border-left: 3px solid var(--vscode-editorWarning-foreground); /* 默认 running 颜色 */
    padding: 0; /* 内部布局自己管理 */
    margin: 4px 0;
    border-radius: var(--radius-small);
    overflow: hidden;
    transition: all 0.2s ease;
}
.tool-call-card[data-status="success"] { border-color: var(--vscode-testing-iconPassed); }
.tool-call-card[data-status="error"] { border-color: var(--vscode-testing-iconFailed); }

.tool-header {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    background: rgba(0,0,0,0.1);
}

/* 消息内的附件徽章 */
.msg-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--vscode-widget-border);
}
.attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 0.85em;
}